#ifndef HOMEPAGE_H
#define HOMEPAGE_H

#include <QWidget>
#include <QThread>
#include "scoreshow.h"
#include "datacontroller.h"

QT_BEGIN_NAMESPACE
namespace Ui { class HomePage; }
QT_END_NAMESPACE

class HomePage : public QWidget
{
    Q_OBJECT

public:
    HomePage(QWidget *parent = nullptr);
    ~HomePage();
    ScoreShow* ss;

private slots:
    void on_checkScore_clicked();

    void on_connectBtn_clicked();
    // 处理数据库连接状态信号
    void dealConnectionState(bool ok);
    // 处理收到的数据表名字们
    void showTableNames(const QVector<QString> tableNameList);

private:
    Ui::HomePage *ui;
    DataController* m_dc;
    QThread* m_dcThread;

signals:
    // 请求连接数据库
    void initSql(QString username, QString password);
    // 请求数据表名字们
    void getTableName();
};
#endif // HOMEPAGE_H
